import MessageMain from "@/app/chat/MessageMain";
import { MenuItemProps, WorkbenchesTabProps } from "./modal/MenuModal";
import { ChatSvg, DataSetSvg, UtilBoxSvg, WorkbenchesSvg } from "@/app/assets/CustomizeSvg";
import KnowledgeBaseView from "@/app/dataset/KnowledgeBase";
import { MenuCode, WorkbenchesType } from "./enumType";
import { WorkbenchesView } from "@/app/workbenches/WorkbenchesView";
import { createApplication, createThirdApplication, deleteApplication, deleteThirdApplication, getApplicationList, getApplicationListLocal, getThirdApplicationList, updateApplication, updateThirdApplication } from "../request/requestApi";
import { UtilBoxView } from "@/app/utilbox/UtilBoxView";

const mainMenu:MenuItemProps[] = [{
    id: 1,
    code: MenuCode.CHAT,
    name: '聊天',
    icon: <ChatSvg width={20} height={20} />,
    content: <MessageMain />,
    onClick: (itemMenu: MenuItemProps) => {
        console.log(itemMenu);
    }
}, {
    id: 2,
    code: MenuCode.WORKBENCHES,
    name: '工作台',
    icon: <WorkbenchesSvg width={20} height={20} />,
    content: <WorkbenchesView />,
    onClick: (itemMenu: MenuItemProps) => {
        console.log(itemMenu);
    }
}, {
    id: 3,
    code: MenuCode.DATASET,
    name: '知识库',
    icon: <DataSetSvg width={20} height={20} />,
    content: <KnowledgeBaseView />,
    onClick: (itemMenu: MenuItemProps) => {
        console.log(itemMenu);
    }
}, {
    id: 4,
    code: MenuCode.UTILBOX,
    name: '工具箱',
    icon: <UtilBoxSvg width={20} height={20} />,
    content: <UtilBoxView />,
    onClick: (itemMenu: MenuItemProps) => {
        console.log(itemMenu);
    }
}];

const workbenchesTabs:WorkbenchesTabProps[] = [{
    id: 1,
    name: "本地应用",
    type: WorkbenchesType.LOCAL,
    isActive: false,
    onClick: (item: WorkbenchesTabProps) => {
        console.log(item);
    },
    get: () => getApplicationListLocal(),
    create: (param?: any) => createApplication(param),
    update: (param?: any) => updateApplication(param),
    delete: (param?: any) => deleteApplication(param),
},{
    id: 2,
    name: "第三方应用",
    type: WorkbenchesType.THIRD,
    isActive: false,
    onClick: (item: WorkbenchesTabProps) => {
        console.log(item);
    },
    get: (searchText: string = "") => getThirdApplicationList(searchText),
    create: (param?: any) => createThirdApplication(param),
    update: (param?: any) => updateThirdApplication(param),
    delete: (param?: any) => deleteThirdApplication(param),
}
// ,{
//     id: 3,
//     name: "工作流",
//     type: WorkbenchesType.WORKFLOW,
//     isActive: false,
//     onClick: (item: WorkbenchesTabProps) => {
//         console.log(item);
//     }
// },{
//     id: 4,
//     name: "插件",
//     type: WorkbenchesType.PLUGIN,
//     isActive: false,
//     onClick: (item: WorkbenchesTabProps) => {
//         console.log(item);
//     }
// }
];

export {
    mainMenu,
    workbenchesTabs
}